# -*- coding: utf-8 -*-
"""
Created on Tue May 28 17:38:16 2024

@author: 29865
"""

from sklearn.neural_network import MLPClassifier
import pandas as pd
data = pd.read_excel('credit.xlsx')
x_train = data.iloc[:600, :14].to_numpy()
y_train = data.iloc[:600, 14].to_numpy()
x_test = data.iloc[600:, :14].to_numpy()
y_test = data.iloc[600:, 14].to_numpy()
clf = MLPClassifier(solver='lbfgs', alpha=1e-5,
                    hidden_layer_sizes=(5, 2), random_state=1)
clf.fit(x_train, y_train)

rv = clf.score(x_train, y_train)
R = clf.predict(x_test)
Z = R - y_test
Rs = len(Z[Z == 0])/len(Z)
